package com.wingscode.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wingscode.common.utils.PageUtils;
import com.wingscode.common.utils.Query;
import com.wingscode.modules.sys.dao.OfferPriceDao;
import com.wingscode.modules.sys.entity.OfferPriceEntity;
import com.wingscode.modules.sys.service.OfferPriceService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 报价
 *
 * @author yan
 */
@Service("offerPriceService")
public class OfferPriceServiceImpl extends ServiceImpl<OfferPriceDao, OfferPriceEntity> implements OfferPriceService {

    @Override
    public List<OfferPriceEntity> getListByInquiryId(Integer inquiryId) { return this.baseMapper.getListByInquiryId(inquiryId); }

    @Override
    public OfferPriceEntity getByUserId(Integer inquiryId, Integer userId) {
        List<OfferPriceEntity> list = this.baseMapper.getByUserId(inquiryId, userId);
        if (list != null && list.size() > 0)
            return list.get(0);

        return null;
    }

    @Override
    public void updateByInquiryId(OfferPriceEntity offerPriceEntity) { this.baseMapper.updateByInquiryId(offerPriceEntity); }
}
